package util

import "strconv"

func NilToString(data interface{}, defaultString string) string {
	if data == nil {
		return defaultString
	}
	return data.(string)
}

func NilToInt(data interface{}, defaultInt int) int {
	if data == nil {
		return defaultInt
	}
	return data.(int)
}

func StringToInt64(str string)int64{
	i,_ := strconv.ParseInt(str, 10, 64)
	return i
}

func StringToFloat64(str string)float64{
	i,_ := strconv.ParseFloat(str,64)
	return i
}





